import Vue from 'vue'
import Router from 'vue-router'
// 使用router
Vue.use(Router);
import Index from '@/pages/home';
import NotFound from '@/components/NotFound'
import Demo from '@/pages/home/demo';
import Cinema from '@/components/Cinema'
import CinemaDetail from '@/components/CinemaDetail'
import Films from '@/pages/films/index';
import FilmDetail from '@/pages/films/children/detail';
import NowPlaying from '@/pages/films/children/now-playing';
import ComingSoon from '@/pages/films/children/coming-soon';
import SignIn from '@/components/SignIn';
import Person from '@/components/Person';
import Map from '@/components/Map';



// 配置路由
const router = new Router({
	mode: 'history',
	routes: [
		 
	
		//配置首页
		{
			path: '/',
			name: 'index',
			component: Index
		},
		{
			path: '/demo',
			name: 'demo',
			component: Demo
		},
		{
			path: '/SignIn',
			name: 'SignIn',
			component: SignIn
		},
		{
			path: '/Map',
			name: 'Map',
			component: Map
		},
		{
			path: '/Person',
			name: 'Person',
			component: Person
		},
		{
			path: '/Cinema',
			name: 'Cinema',
			component: Cinema
		},
		{
			path: '/CinemaDetail',
			name: 'CinemaDetail',
			component: CinemaDetail
		},
		
		{
			path: '/films/detail',
			name: 'film-detail',
			component: FilmDetail
		},
		
		{
			path: '/films',
			name: 'films',
			component: Films,
			// 重定向
			redirect:{
				name: 'now-playing'
			},
			children: [
			{
				path: 'now-playing',
				name: 'now-playing',
				component: NowPlaying
			},
			{
				path: 'coming-soon',
				name: 'coming-soon',
				component: ComingSoon
			}
			
		]
	},
			{
            /*404配置*/
            path: '*',
            component: NotFound
       	}
	]
});
export default router;
